package com.h3c.tj_nsh.UI.Activities;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.h3c.tj_nsh.R;
import com.h3c.tj_nsh.UI.MVP.Login.LoginPresent;
import com.h3c.tj_nsh.UI.MVP.Login.LoginView;
import com.h3c.tj_nsh.View.TranslucentLayout;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 登录页面
 */
public class LoginActivity extends BaseActivity implements LoginView {


    @Bind(R.id.et_sign_in_account)
    EditText mEtSignInAccount;
    @Bind(R.id.et_sign_in_pwd)
    EditText mEtSignInPwd;
    @Bind(R.id.btn_reigst)
    Button mBtnReigst;
    @Bind(R.id.btn_logout)
    Button mBtnLogout;
    @Bind(R.id.btn_sign_in)
    Button mBtnSignIn;
    @Bind(R.id.tv_loading_dialog_msg)
    TextView mTvLoadingDialogMsg;
    @Bind(R.id.activity_loading_dialog)
    TranslucentLayout mActivityLoadingDialog;
    private LoginPresent mLoginPresent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);
        mLoginPresent = new LoginPresent(this);

    }


    @OnClick({R.id.btn_reigst, R.id.btn_logout, R.id.btn_sign_in})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_reigst:
                mLoginPresent.topLeaderLogin();
                break;
            case R.id.btn_logout:
                mLoginPresent.departmentLogin();
                break;
            case R.id.btn_sign_in:
                mLoginPresent.engineerLogin();
                break;
        }
    }

    @Override
    public Context getContext() {
        return this;
    }
}
